cmake_minimum_required(VERSION 3.18.1)
project(figo_player_plugin)

# 设置C++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 设置FFmpeg路径
set(FFMPEG_ROOT ${CMAKE_SOURCE_DIR}/../../app/src/main/jniLibs)

# 包含目录
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${FFMPEG_ROOT}/include)

# 源文件
set(SOURCES
    ffmpeg_wrapper.cpp
    jni_interface.cpp
    logger.cpp
)

# 创建库
add_library(figo_player_plugin SHARED ${SOURCES})

# 链接FFmpeg库
target_link_libraries(figo_player_plugin
    ${FFMPEG_ROOT}/${ANDROID_ABI}/libavcodec.so
    ${FFMPEG_ROOT}/${ANDROID_ABI}/libavformat.so
    ${FFMPEG_ROOT}/${ANDROID_ABI}/libavutil.so
    ${FFMPEG_ROOT}/${ANDROID_ABI}/libswscale.so
    ${FFMPEG_ROOT}/${ANDROID_ABI}/libswresample.so
    log
    android
)
